package com.cashmanager.client;

import com.cashmanager.client.datasource.CashDataSource;
import com.cashmanager.client.view.base.BaseVPage;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.CheckboxItem;
import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;

public class CashPage extends BaseVPage{
	private ListGrid listGrid = new LiveGrid();
	public CashPage(){
		listGrid.setDataSource(CashDataSource.getInstance());
		VLayout hl = new VLayout();
		DynamicForm base = new DynamicForm();
		
//        ComboBoxItem bank = new ComboBoxItem();  
//        bank.setTitle("选择银行");  
//        bank.setType("comboBox");  
//        bank.setValueMap("中国银行", "建设银行", "农业银行");
//        
//        ComboBoxItem branch = new ComboBoxItem();  
//        branch.setTitle("选择网点");  
//        branch.setType("comboBox");  
//        branch.setValueMap("中国银行", "建设银行", "农业银行");
//        
//        ComboBoxItem atm = new ComboBoxItem();  
//        atm.setTitle("选择ATM");  
//        atm.setType("comboBox");  
//        atm.setValueMap("中国银行", "建设银行", "农业银行");
//        
//        CheckboxItem alarmCash = new CheckboxItem();  
//        alarmCash.setTitle("可疑币");  
//  
//        CheckboxItem falseCash = new CheckboxItem();  
//        falseCash.setTitle("假币");  
//  
//        
        
		TextItem d1 = new TextItem("起始日期");
		d1.setValue("2012-05-01");
		TextItem d2 = new TextItem("终止日期");
		d2.setValue("2012-06-01");
//	    base.setIsGroup(true);  
//	    base.setGroupTitle("查询");
//	    base.setHeight("20%");  		    
	    base.setWidth("100%");  
	    base.setNumCols(6);
//	    base.setFields(bank, branch, atm, d1,d2, alarmCash, falseCash);			
	    base.setFields(d1, d2);
	    hl.addMember(base);
	    HLayout btnLayout = new HLayout();
	    btnLayout.setWidth100();
	    btnLayout.setHeight(40);
	    btnLayout.setMargin(2);
	    btnLayout.setAlign(Alignment.RIGHT);
	    IButton search = new IButton("查询");
	    btnLayout.addMember(search);
	    addMember(hl);
		addMember(btnLayout);
	    addMember(listGrid);
	}
	
	
	

	
}
